Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

feat(openai-codex): profile-scoped oauth + email/limits - #11134

Closed
loject wants to merge 2 commits into
RooCodeInc:mainfrom
loject:feature/openai-codex-profile-scoped-auth
Closed

feat(openai-codex): profile-scoped oauth + email/limits#11134
loject wants to merge 2 commits into
RooCodeInc:mainfrom
loject:feature/openai-codex-profile-scoped-auth

Conversation

@loject

@loject loject commented Jan 31, 2026

Copy link
Copy Markdown

Related GitHub Issue

Closes: #11094

Roo Code Task Context (Optional)

https://app.roocode.com/share/d6d78501-039a-4118-a346-6349944ad9dd

Description

  • Scoped OpenAI Codex OAuth credentials to provider profiles so each profile maintains its own session and tokens.
  • Added account email extraction from id_token to surface the connected account in the UI.
  • Refreshed Codex usage limits when switching profiles to avoid stale rate‑limit data.
  • Updated webview state/types and UI wiring to pass and display the account email and ensure limits refresh on profile changes.

Test Procedure

  1. Install dependencies (workspace root): pnpm install --frozen-lockfile
  2. Backend tests: cd src && npx vitest run api/providers/tests/openai-codex-native-tool-calls.spec.ts core/webview/tests/webviewMessageHandler.spec.ts
  3. UI tests: cd webview-ui && npx vitest run src/components/settings/tests/ApiOptions.spec.tsx
  4. Manual: create multiple OpenAI Codex profiles, authenticate each with different accounts, verify email and usage limits update when switching profiles.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

image

Documentation Updates

Additional Notes

None.

Get in Touch

loject


Important

Introduces profile-scoped OAuth for OpenAI Codex, adding account email display and refreshing usage limits on profile switch.

  • Behavior:
    • Scoped OpenAI Codex OAuth credentials to provider profiles in openai-codex.ts.
    • Added account email extraction from id_token in openai-codex.ts.
    • Refreshed Codex usage limits on profile switch in ClineProvider.ts.
  • UI Components:
    • Updated ApiOptions.tsx to pass openAiCodexAccountEmail and currentApiConfigName.
    • Modified OpenAICodex.tsx to display account email and handle sign-in/out.
    • Enhanced OpenAICodexRateLimitDashboard.tsx to refresh limits on profile change.
  • Misc:
    • Added openAiCodexAccountEmail to ExtensionState in vscode-extension-host.ts.

This description was created by Ellipsis for 11cddf8. You can customize this summary. It will automatically update as commits are pushed.

@loject
loject requested review from cte, jr and mrubens as code owners January 31, 2026 05:31
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. Enhancement New feature or request labels Jan 31, 2026
@ghost

ghost commented Jan 31, 2026

Copy link
Copy Markdown

Rooviewer Clock   See task on Roo Cloud

All issues resolved. The test setup fix in commit 65a15d5 correctly adds the getState() mock with required profile data.

  • Update requestOpenAiCodexRateLimits test setup in webviewMessageHandler.spec.ts to mock getState() with profile data
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Comment thread src/core/webview/webviewMessageHandler.ts
The tests were failing when run in isolation due to missing getState()
mock with currentApiConfigName and listApiConfigMeta properties.
Added the mock to the beforeEach block similar to other describe blocks
in the file.
@loject

loject commented Jan 31, 2026

Copy link
Copy Markdown
Author

@mrubens @cte @jr can review pls?

@loject loject closed this by deleting the head repository May 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] OpenAI (ChatGPT Plus/Pro OAuth): support multiple accounts / account switching

2 participants